import { ref, defineComponent, h } from "vue";
import BasicModel from "@/components/basic-model";
import { NButton } from "naive-ui";
import { isVNode } from "@/types/utils";

export default defineComponent({
  name: "model",
  setup() {
    const isShow = ref(false);
    const openHandle = () => {
      console.log("点击===");
      isShow.value = !isShow.value;
    };
    const isV = h("span");
    const isSpan = isVNode(isV);
    console.log("判断是不是vnode=====", isSpan);
    return () => (
      <div>
        <h1>model组件</h1>
        <NButton onClick={openHandle}>打开</NButton>
        <BasicModel v-model:show={isShow.value} />
        {/* {isShow.value ? <BasicModel v-model:show={isShow.value} /> : null} */}
      </div>
    );
  },
});
